﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data.SqlClient;
using System.Data;
using SmallSpider.Dal;

namespace SmallSpider.Dal
{
    public class DAL_WebSite : Dal_Base
    {
        public int InsertWebSite(string strName, string strUrl, string strKeywords, string strDesc, string strCharSet)
        {
            using (SqlConnection con = new SqlConnection(strConnectionString))
            {
                SqlParameter[] paras = new SqlParameter[6];
                paras[0] = new SqlParameter("@strName", strName);
                paras[1] = new SqlParameter("@strURL", strUrl);
                paras[2] = new SqlParameter("@strKeywords", strKeywords);
                paras[3] = new SqlParameter("@strDescription", strDesc);
                paras[4] = new SqlParameter("@strCharset", strCharSet);
                paras[5] = new SqlParameter("@RETURN_VALUE", string.Empty);
                
                paras[5].Direction = ParameterDirection.ReturnValue;

                object o = ExcuteNonQuery_Proc_Return("AddWebSite", paras);
                //返回id值    
                return Convert.ToInt32(o);
            }
        }

    }
}
